import { defHttp } from '@/utils/http/axios';
import { ErrorMessageMode } from '#/axios';
import {DeptListItem} from './model/deptModel'
enum Api {
  getDeptList = '/dept/getAllDept',
  UpdateDept = '/dept/updateDept',
  AddDept = '/dept/addDept',
  DeleteDept = '/dept/deleteDept/'
}

/**
 * @description: Get user menu based on id
 */

export const getDeptList = (params) => {
  return defHttp.get<DeptListItem>({ params,url: Api.getDeptList });
};
export const UpdateDept = (params, mode: ErrorMessageMode = 'message') => {
  return defHttp.put<any>({ params,url: Api.UpdateDept },
    {
      errorMessageMode: mode,
    },);
};
export const AddDept = (params, mode: ErrorMessageMode = 'message') => {
  return defHttp.post<any>({ params,url: Api.AddDept },
    {
      errorMessageMode: mode,
    },);
};
export const DeleteDept = (params, mode: ErrorMessageMode = 'message') => {
  return defHttp.delete<any>({url: Api.DeleteDept + params },
    {
      errorMessageMode: mode,
    },);
};
